Skip to content

Enable no-extra-semi & no-irregular-whitespace #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 20, 2020

Conversation

mgol
Copy link
Member

@mgol mgol commented Apr 8, 2020

The no-extra-semi rule:
https://eslint.org/docs/rules/no-extra-semi
disallows unnecessary semicolons, e.g. it forbids the following:

var x = 5;;

function foo() {
    // code
};

In jQuery we usually don't add a semicolon at the end of function declarations
but I found a few cases where we do, creating an inconsistency.

The no-irregular-whitespace rule:
https://eslint.org/docs/rules/no-irregular-whitespace
forbids most whitespaces that may be hard to notice in source. We have one such
occurrence in Core code that would be good to forbid.

Fixes #15

cc @jquery/core @Krinkle @leobalter

The no-extra-semi rule:
https://eslint.org/docs/rules/no-extra-semi
disallows unnecessary semicolons, e.g. it forbids the following:
```js
var x = 5;;

function foo() {
    // code
};
```

In jQuery we usually don't add a semicolon at the end of function declarations
but I found a few cases where we do, creating an inconsistency.

The no-irregular-whitespace rule:
https://eslint.org/docs/rules/no-irregular-whitespace
forbids most whitespaces that may be hard to notice in source. We have one such
occurrence in Core code that would be good to forbid.

Fixes jquery#15
@mgol mgol changed the title Enable no-extra-semi Enable no-extra-semi & no-irregular-whitespace Apr 8, 2020
@Krinkle
Copy link
Member

Krinkle commented Apr 8, 2020

@mgol Thanks, LGTM! Seems in line with the spirit of https://contribute.jquery.org/style-guide/js/ as well, although not explicitly spelled out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable some eslint:recommended rules
4 participants